import './assets/main.css'
import './assets/import.css'
import 'normalize.css/normalize.css'
import 'amfe-flexible'
import './utils/rem'

import { createApp } from 'vue'
import App from './App.vue'

// 引入pinia状态机
import { createPinia } from 'pinia'
// 引入pinia插件，解决刷新页面数据丢失问题
import piniaPersist from 'pinia-plugin-persist'

// 引入国际化配置
import i18n from './lang'

// 引入路由配置
import router from './router'

// 引入Element-plus图标库
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)

// 注册Element-plus图标库
for (const [key, value] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, value)
}

// 创建pinia实例
const pinia = createPinia()
// 注册pinia插件
pinia.use(piniaPersist)

app.use(router).use(i18n).use(pinia).mount('#app')
